<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <title>操舱记录单</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../css/aui.2.0.css" />
    <link rel="stylesheet" type="text/css" href="../css/style.css" />
    <style>
      .hospital > div{
        width: 100%;
        height: 40px;
        margin-top: 5px;
      }

      .aui-iconfont{
        font-size: 14px;
      }
      td{padding:10px;}
    </style>
</head>

<body>
    <section class="hospital" v-if="showPage">
      <!-- 左侧 -->
      <div id="table-left" style="width:35%;float:left;" v-for="(OperatingRecord_itme, index) in OperatingRecord" v-if="OperatingRecord_itme.F_id">
        <table style="font-size:14px; width: 100%" border="1">
          <tr>
            <td rowspan="8">治<br/>疗<br/>方<br/>案</td>
            <td>治疗压力</td>
            <td>{{OperatingRecord_itme.F_yali}}</td>
          </tr>
          <tr>
            <td>升压时间</td>
            <td>{{OperatingRecord_itme.F_jiayaTime}}</td>
          </tr>
          <tr>
            <td>稳压时间</td>
            <td>{{OperatingRecord_itme.F_wenyaTime}}</td>
          </tr>
          <tr>
            <td>吸氧方案</td>
            <td>{{OperatingRecord_itme.F_xiyangfa1}}</td>
          </tr>
          <tr>
            <td>吸氧方案二</td>
            <td>{{OperatingRecord_itme.F_xiyangfa2}}</td>
          </tr>
          <tr>
            <td>减压时间</td>
            <td>{{OperatingRecord_itme.F_jianyaTime}}</td>
          </tr>
          <tr>
            <td>出舱时间</td>
            <td>{{OperatingRecord_itme.F_chucangTime}}</td>
          </tr>
          <tr>
            <td>治疗总时程min</td>
            <td>{{OperatingRecord_itme.F_shicheng}}</td>
          </tr>
          <tr>
            <td rowspan="4">舱<br/>内<br/>氧<br/>浓<br/>度</td>
            <td>第一次吸氧末</td>
            <td>{{OperatingRecord_itme.F_xiyang1}}</td>
          </tr>
          <tr>
            <td>第二次吸氧末</td>
            <td>{{OperatingRecord_itme.F_xiyang2}}</td>
          </tr>
          <tr>
            <td>暂无数据</td>
            <td>暂无数据</td>
          </tr>
          <tr>
            <td>减 压 末</td>
            <td>{{OperatingRecord_itme.F_jianyamo}}</td>
          </tr>
          <tr>
            <td rowspan="2">舱<br/>内<br/>温<br/>度</td>
            <td>加压前 {{OperatingRecord_itme.F_jiayawendu}}℃</td>
            <td>稳压始 {{OperatingRecord_itme.F_wenyawendu}}℃</td>
          </tr>
          <tr>
            <td>减压始 {{OperatingRecord_itme.F_jianyawendu}}℃</td>
            <td>减压末 {{OperatingRecord_itme.F_jianmowendu}}℃</td>
          </tr>
          <tr>
            <td colspan="3">备注：{{OperatingRecord_itme.F_beizhu}}</td>
          </tr>
        </table>
        <img v-bind:src="OperatingRecord_itme.F_biaoqian_img"  id="avatar" name="avatar"  width="300px;">
      </div>
      <!-- 右侧 -->
      <div id="table-right" class="aui-content aui-margin-b-15"  style="width:65%;float:right;">
          <table style="font-size:14px;width: 100%" border="1">
              <tr>
                <td>序号</td>
                <td>姓名</td>
                <td>性别</td>
                <td>年龄</td>
                <td>体位</td>
                <td>供氧方式</td>
                <td>心电监护</td>
                <td>陪舱</td>
                <td>管道</td>
                <td>备注</td>
              </tr>
              <tr v-for="(TreatmentRecord_itme, index) in TreatmentRecord" v-if="TreatmentRecord_itme.aName" @click="Cabin_TreatmentRecord_Frame(TreatmentRecord_itme.F_id)">
                  <td>{{index+1}}</td>
                  <td>{{TreatmentRecord_itme.aName}}</td>
                  <td>{{TreatmentRecord_itme.sex}}</td>
                  <td>{{TreatmentRecord_itme.age}}</td>
                  <td>{{TreatmentRecord_itme.F_tiwei}}</td>
                  <td>氧舱</td>
                  <td>正常</td>
                  <td>{{TreatmentRecord_itme.F_peihu}}</td>
                  <td>{{TreatmentRecord_itme.F_guandao}}</td>
                  <td>{{TreatmentRecord_itme.F_xiyang}}</td>
              </tr>
            </table>
      </div>
    </section>
</body>
</html>

<script src="../script/api.js" charset="utf-8"></script>
<script src="../script/vue.js" charset="utf-8"></script>
<script src="../script/jquery-2.0.0.min.js"></script>
<script src="../js/ToConfigure.js" charset="utf-8"></script>
<script src="../script/aui-toast.js" charset="utf-8"></script>
<script type="text/javascript">
var vm = null;
  apiready = function () {

    vm = new Vue({
      el: '.hospital',
      data: {
        manIcon: {
          backgroundImage: "url(../image/sex_man.png)"
        },
        womanIcon: {
          backgroundImage: "url(../image/sex_woman.png)"
        },
        CabinInformation: [],
        OperatingRecord: [],
        TreatmentRecord: [],
        Url_IP: "",
        ID: 0,
        showPage:false,
      },
      created(){
        //获取所属医院IP地址
        this.Url_IP = ToConfigure_IP("Gorgeous");
        //获取舱次Id 通过舱次Id获取舱次人员
        this.ID = api.pageParam.F_id;
        // if (this.ID > 0) {
        //     // this.Query_HO_HatchLocation(this.ID);
        //     this.Android_Print_OperatingRecord(this.ID);
        // }
      },
      mounted:function(){
        this.$nextTick(function(){     
          // this.Android_Print_OperatingRecord(this.ID);　
          // console.log(this.ID);　　　　　　　　
          if (this.ID > 0) {
            this.Android_Print_OperatingRecord(this.ID);
        }　
        })
    },
      methods: {
        //查询舱次人员以及座位
        // Query_HO_HatchLocation: function(ID) {
        //   // console.log(ID);
        //     //判断舱次Id不等于空
        //     if (ID > 0 && ID != undefined) {
        //         api.ajax({
        //             url: this.Url_IP + 'HyperbaricOxygen/CabinTreatment/Query_HO_HatchLocation',
        //             data: {
        //                 values: {
        //                     ID: ID
        //                 }
        //             },
        //             method: 'get',
        //         }, function(ret, err) {
        //             if (ret) {
        //               console.log('----------------------------------------------')
        //           console.log(JSON.stringify(ret));
        //                 vm.CabinInformation = ret;
        //             } else {
        //                 alert(JSON.stringify(err));
        //             }
        //         });
        //     }
        // },
        Android_Print_OperatingRecord: function(ID){
          if(ID > 0 && ID != undefined){
            api.ajax({
                url: this.Url_IP + 'HyperbaricOxygen/ModuleRecord/Android_Print_OperatingRecord',
                data: {
                    values: {
                        F_cangcid: ID
                    }
                },
                method: 'get',
            }, function(ret, err) {
                if (ret) {
                  this.showPage = true;
                    vm.OperatingRecord = ret;
                    // console.log('----------------------------------------------')
                    // console.log(JSON.stringify(ret));
                    Android_Print_TreatmentRecord(ret[0].F_id);
                    
                } else {
                  // console.log('++++++++++++++++++++++++++++++++++++++')
                  //   console.log(JSON.stringify(ret));
                  alert("该舱次未提交，无法查看操舱记录单！");
                }
            });
          }
        },
          Cabin_TreatmentRecord_Frame: function(TreatmentRecord_id){
            api.openWin({
                name: 'Cabin_TreatmentRecord-header',
                url: './Cabin_TreatmentRecord-header.html',
                pageParam: {
                    F_id: TreatmentRecord_id
                }
            });
          }
      }
    })
  }
   function Android_Print_TreatmentRecord(F_ORecord){
    if(F_ORecord > 0 && F_ORecord != undefined){
      //获取所属医院IP地址
      var Url_IP = ToConfigure_IP("Gorgeous");
      api.ajax({
        url: Url_IP + 'HyperbaricOxygen/ModuleRecord/Android_Print_TreatmentRecord',
          data: {
              values: {
                  F_ORecord: F_ORecord
              }
          },
          method: 'get',
      }, function(ret, err) {
          if (ret) {
              vm.TreatmentRecord = ret;
          } else {
              alert(JSON.stringify(err));
          }
      });
    }
  }

</script>
